home *** CD-ROM | disk | FTP | other *** search
- Path: maple.sover.net!mountain
- From: mountain@maple.sover.net (Steve Mount)
- Newsgroups: comp.lang.c
- Subject: Comments on function requested
- Date: 19 Mar 1996 14:09:22 GMT
- Organization: SoVerNet, Inc.
- Message-ID: <4imf6j$pto@thrush.sover.net>
- NNTP-Posting-Host: maple.sover.net
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hi all. I'm no newbie to C, but I've always been a little leery about
- pointer arithmetic. I need to write a function to convert a buffer to
- all lower case (and anohter for upper). Below please see my code.
- Any comments? I'm concerned my typecasts might break the code for some
- data, but I'm not positive. Thanks in advance:
-
- void *memlwr(void *buf, int len)
- {
- char *end=(char *)buf+len;
- char *s;
- for (s=(char *)buf ; s<end; s++) *s = tolower(*s);
- return(buf);
- }
-
- +============================================================================+
- | Steve Mount, Software Engineer Work: sjjm@hawkeye.idx.com |
- | CIS: 73720,3404 MSN: S_Mountain Home: mountain@sover.net |
- | AOL: Mountain |
- | WWW: http://www.sover.net/~mountain/ "Fight, Win, Prevail!" |
- +============================================================================+
-